/**
* @author AlbertDarren
* @contact 2563491540@qq.com
*/
#include <cstdio>

using namespace std;

int main_1058_1()
{
    long long A[3],B[3],Sum=0,level1=29,level2=17;
    scanf("%lld.%lld.%lld %lld.%lld.%lld",&A[0],&A[1],&A[2],&B[0],&B[1],&B[2]);
    Sum+=A[0]*level1*level2+A[1]*level1+A[2];
    Sum+=B[0]*level1*level2+B[1]*level1+B[2];
    printf("%lld.%lld.%lld",Sum/(level1*level2),Sum%(level1*level2)/level1,Sum%level1);
	return 0;
}
